﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace University_students
{
    class Students
    {
        public string lastName;
        public string cridentials;
        public DateTime dateOfBirth;
        public int[] marks = new int[5];
        private static int StudentNumber = 0;

        public void AddStudentsInfo()
        {
            //Students nextStudent = new Students();
            //Console.WriteLine("Enther the last name of student: ");
            //lastName = Console.ReadLine();
            //Console.WriteLine("Enther the cridentials of student: ");
            //cridentials = Console.ReadLine();
            //Console.WriteLine("Enther the date of birth:");
            //dateOfBirth = DateTime.Parse(Console.ReadLine());

            lastName = "Шошин" + StudentNumber;
            cridentials = "D.D.";
            Random rnd = new Random();
            dateOfBirth = new DateTime(rnd.Next(1991, 1999), rnd.Next(1, 13), rnd.Next(1, 25));
           
            Students.StudentNumber++;
        }

        public int[] AllMarks()
        {
            Random rnd = new Random();
            //Console.WriteLine("Enther five marks: ");
            for (int i = 0; i < marks.Length; i++)
            {
                marks[i] = rnd.Next(0, 100);
            }

            return marks;
        }

        public double avarageOfAllMarks()
        {
            double sumOfMarks = 0;
            for (int i = 0; i < marks.Length; i++)
            {
                sumOfMarks += marks[i];
            }
            double avarageMarks = sumOfMarks / marks.Length;
            return avarageMarks;
        }



        public void StudentInfo()
        {
            Console.WriteLine("Student - {0} {1} {2}\tAvarage mark is - {3}", lastName, cridentials, dateOfBirth.ToShortDateString(), avarageOfAllMarks());
        }

    }
}
